﻿@model LanHomepage.ViewModels.BaseViewModel

<!DOCTYPE html>
<html>

   
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
</head>
<body>
   <header>
       <div class="content-wrapper">
            <img class="logo" src="~/Images/Layout/404_logo_frontpage.png" />
            <div class="navigation">
                <div class="overlay">
                    <ul>
                        <li>
                            @Html.ActionLink("Forside", "Mainpage", "Main", new object { }, new { @class = "navigation" })
                        </li>
                        <li>
                            @Html.ActionLink("Kiosk", "Kiosk", "Kiosk", new object { }, new { @class = "navigation" })
                        </li>
                        <li>
                            @Html.ActionLink("Kontakt", "Kontakt", "Kontakt", new object { }, new { @class = "navigation" })
                        </li>
                    </ul>
                </div>
            </div>
       </div>
   </header>
    <section class="sponsor-section">
        <div class="sponsor-headline">
            <h3>Sponsors</h3>
        </div>
        @if(User.IsInRole("Admin"))
        {
            using (Html.BeginForm("FileUpload", "Base", FormMethod.Post, new { enctype = "multipart/form-data" }))
            {      
                <div class="sponsor-image-submit">  
                    <input type="file" name="file" />  
                    <input type="url" name="url" />
                    <input type="submit" value="OK" />
                </div>
            }
        }
        <div class="sponsor-images">
            @foreach (var image in Model.Images) 
            {
                @Html.Partial("_sponsorLogos", new { Image = image });
            }
        </div>
    </section>
    <section class="login-section">
        @if (User.Identity.IsAuthenticated)
        {
            using(Html.BeginForm("Logout", "Base"))
            {
                <button class="logout-button" type="submit">Logout</button>
            }
        }
        else 
        {           
            using(Html.BeginForm("Login", "Base"))
            {
                @Html.LabelFor(u => u.Username)
                @Html.TextBoxFor(u => u.Username)

                @Html.LabelFor(p => p.Password)
                @Html.PasswordFor(x => x.Password, new { value = Model.Password })

                <button class="login-button" type="submit">Login</button>
            }
        }
    </section>

     @RenderSection("featured", required: false)
    <section class="content-wrapper">
        @RenderBody()
    </section>

    <footer>
        <div class="content-wrapper">
            <div class="cover" />
            <p>&copy; @DateTime.Now.Year / 404-Lan</p>
        </div>
    </footer>
</body>
    @Scripts.Render("~/bundles/scripts")
    @RenderSection("scripts", required: false)
    @Styles.Render("~/Content/css")
</html>
